Redirect a complex URL to another one, either in httpd.conf or with

Redirect a complex URL to another one, either in httpd.conf or with

am 09.03.2010 00:11:45 von Madan Thapa

--00504502cc9e6340ae0481523016
Content-Type: text/plain; charset=ISO-8859-1

Hi,

Can you suggest any redirect rule for redirecting



https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28

to page

https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27






Thanks

--00504502cc9e6340ae0481523016
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


Hi,

Can you suggest any redirect rule=A0 for redirecting
>

k=3Dview&id=3D18&Itemid=3D28">https://www.domain.com /index.php?opt=
=3Ddom_cont&task=3Dview&id=3D18&Itemid=3D28



to page

nt&task=3Dview&id=3D17&Itemid=3D27">https://www. domain.com/inde=
x.php?opt=3Ddom_cont&task=3Dview&id=3D17&Itemid= 3D27

>





Thanks





--00504502cc9e6340ae0481523016--

Re: Redirect a complex URL to another one, either in

am 09.03.2010 00:19:26 von Eric Covener

On Mon, Mar 8, 2010 at 6:11 PM, MadTh wrote:
>
> Hi,
>
> Can you suggest any redirect rule=A0 for redirecting
>
>
>
> https://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview& id=3D18&Itemi=
d=3D28
>
> to page
>
> https://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview& id=3D17&Itemi=
d=3D27

http://wiki.apache.org/httpd/RewriteQueryString


--=20
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Redirect a complex URL to another one, either in

am 09.03.2010 00:25:00 von Gustavo Straube

--00163641780bbe66260481525f85
Content-Type: text/plain; charset=ISO-8859-1

Hi!

You must to write some kind of script, maybe PHP since you're using it, and
subtract 1 from both parameters. With mod_rewrite olny you're unable to do
this, since it works only with strings (using regex).


On Mon, Mar 8, 2010 at 8:11 PM, MadTh wrote:

>
> Hi,
>
> Can you suggest any redirect rule for redirecting
>
>
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>
> to page
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>
>
>
>
>
>
> Thanks
>
>
>
>

--00163641780bbe66260481525f85
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi!


You must to write some kind of script, maybe PHP sin=
ce you're using it, and subtract 1 from both parameters. With mod_rewri=
te olny you're unable to do this, since it works only with strings (usi=
ng regex).






--00163641780bbe66260481525f85--

Re: Redirect a complex URL to another one, either in

am 09.03.2010 00:48:43 von Igor Cicimov

--00163628521295624c048152b4c3
Content-Type: text/plain; charset=ISO-8859-1

Well for a simple redirect this should work (not tested)

RewriteEngine On
RewriteCond %{QUERY_STRING} opt=dom_cont
RewriteCond %{QUERY_STRING} task=view
RewriteCond %{QUERY_STRING} id=18
RewriteCond %{QUERY_STRING} Itemid=28
RewriteRule ^/index.php$
https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27[R,L]

if this is your only link you want to redirect ... but something tells me
you will need more generic one that redirects links with id=xx&Itemid=yy to
id=xx-1&Itemid=yy-1 ... am I right :)

In that case try this:

RewriteEngine On
RewriteCond %{QUERY_STRING} opt=dom_cont
RewriteCond %{QUERY_STRING} task=view
RewriteCond %{QUERY_STRING} id=([0-9]{2})
RewriteCond %{QUERY_STRING} Itemid=([0-9]{2})
RewriteRule ^/index.php$
https://www.domain.com/index.php?opt=dom_cont&task=view&&id=%1-1&Itemid=%2-1
[R,L]

not sure though if apache will do the math on %1 and %2 or take the -1 part
as string...curious to find out from you :)

Cheers

On Tue, Mar 9, 2010 at 10:11 AM, MadTh wrote:

>
> Hi,
>
> Can you suggest any redirect rule for redirecting
>
>
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>
> to page
>
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>
>
>
>
>
>
> Thanks
>
>
>
>

--00163628521295624c048152b4c3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Well for a simple redirect this should work (not tested)

RewriteEngi=
ne On
RewriteCond %{QUERY_STRING} opt=3Ddom_cont
RewriteCond %{QUERY_=
STRING} task=3Dview
RewriteCond %{QUERY_STRING} id=3D18
RewriteCond %=
{QUERY_STRING} Itemid=3D28


RewriteRule ^/index.php$ dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &id=3D17&am=
p;Itemid=3D27
[R,L]


if this is your only link you want to redirect ... but something tells =
me you will need more generic one that redirects links with id=3Dxx&Ite=
mid=3Dyy to id=3Dxx-1&Itemid=3Dyy-1=A0 ... am I right :)


In that case try this:

RewriteEngine On
RewriteCond %{QUERY_S=
TRING} opt=3Ddom_cont
RewriteCond %{QUERY_STRING} task=3Dview
Rewrite=
Cond %{QUERY_STRING} id=3D([0-9]{2})
RewriteCond %{QUERY_STRING} Itemid=
=3D([0-9]{2})

RewriteRule ^/index.php$ dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &
&i=
d=3D%1-1&Itemid=3D%2-1 [R,L]


not sure though if apache will do the math on %1 and %2 or take the -1 =
part as string...curious to find out from you :)

Cheers

class=3D"gmail_quote">On Tue, Mar 9, 2010 at 10:11 AM, MadTh tr"><madan=
..feedback@gmail.com
>
wrote:

r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,

Can you suggest any redirect rule=A0 for redirecting
>

k=3Dview&id=3D18&Itemid=3D28" target=3D"_blank">https://www.domain.=
com/index.php?opt=3Ddom_cont&task=3Dview&id=3D18& ;Itemid=3D28 >




to page

nt&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">https://w=
ww.domain.com/index.php?opt=3Ddom_cont&task=3Dview&i d=3D17&Item=
id=3D27










Thanks







--00163628521295624c048152b4c3--

Re: Redirect a complex URL to another one, either in

am 09.03.2010 01:40:49 von Madan Thapa

--001636e9078fe068fc0481536e42
Content-Type: text/plain; charset=ISO-8859-1

none worked so far








On Tue, Mar 9, 2010 at 5:18 AM, Igor Cicimov wrote:

> Well for a simple redirect this should work (not tested)
>
> RewriteEngine On
> RewriteCond %{QUERY_STRING} opt=dom_cont
> RewriteCond %{QUERY_STRING} task=view
> RewriteCond %{QUERY_STRING} id=18
> RewriteCond %{QUERY_STRING} Itemid=28
> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27[R,L]
>
> if this is your only link you want to redirect ... but something tells me
> you will need more generic one that redirects links with id=xx&Itemid=yy to
> id=xx-1&Itemid=yy-1 ... am I right :)
>
> In that case try this:
>
> RewriteEngine On
> RewriteCond %{QUERY_STRING} opt=dom_cont
> RewriteCond %{QUERY_STRING} task=view
> RewriteCond %{QUERY_STRING} id=([0-9]{2})
> RewriteCond %{QUERY_STRING} Itemid=([0-9]{2})
> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&&id=%1-1&Itemid=%2-1
> [R,L]
>
> not sure though if apache will do the math on %1 and %2 or take the -1 part
> as string...curious to find out from you :)
>
> Cheers
>
>
> On Tue, Mar 9, 2010 at 10:11 AM, MadTh wrote:
>
>>
>> Hi,
>>
>> Can you suggest any redirect rule for redirecting
>>
>>
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 8&Itemid=28
>>
>> to page
>>
>> https://www.domain.com/index.php?opt=dom_cont&task=view&id=1 7&Itemid=27
>>
>>
>>
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>

--001636e9078fe068fc0481536e42
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

none worked so far








uote">On Tue, Mar 9, 2010 at 5:18 AM, Igor Cicimov < href=3D"mailto:icicimov@gmail.com">icicimov@gmail.com> wrote=
:

204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well for a simple=
redirect this should work (not tested)

RewriteEngine On
RewriteC=
ond %{QUERY_STRING} opt=3Ddom_cont

RewriteCond %{QUERY_STRING} task=3Dview
RewriteCond %{QUERY_STRING} id=
=3D18
RewriteCond %{QUERY_STRING} Itemid=3D28


RewriteRule ^/index.php$ dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &id=3D17&am=
p;Itemid=3D27
[R,L]



if this is your only link you want to redirect ... but something tells =
me you will need more generic one that redirects links with id=3Dxx&Ite=
mid=3Dyy to id=3Dxx-1&Itemid=3Dyy-1=A0 ... am I right :)


In that case try this:

RewriteEngine On
RewriteCond %{QUERY_S=
TRING} opt=3Ddom_cont
RewriteCond %{QUERY_STRING} task=3Dview
Rewrite=
Cond %{QUERY_STRING} id=3D([0-9]{2})
RewriteCond %{QUERY_STRING} Itemid=
=3D([0-9]{2})


RewriteRule ^/index.php$ dom_cont&task=3Dview&id=3D17&Itemid=3D27" target=3D"_blank">htt=
ps://www.domain.com/index.php?opt=3Ddom_cont&task=3Dview &
&i=
d=3D%1-1&Itemid=3D%2-1 [R,L]



not sure though if apache will do the math on %1 and %2 or take the -1 =
part as string...curious to find out from you :)

Cheers



--001636e9078fe068fc0481536e42--

Re: Redirect a complex URL to another one, either in

am 09.03.2010 01:44:29 von Eric Covener

On Mon, Mar 8, 2010 at 6:48 PM, Igor Cicimov wrote:

> RewriteRule ^/index.php$
> https://www.domain.com/index.php?opt=dom_cont&task=view&&id= %1-1&Itemid=%2-1
> [R,L]
>

You probably need a RewriteMap to do that increment.

--
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org